<template>
  <el-card>
    <el-tabs v-model="activeTab" @tab-click="getInterviewList">
      <el-tab-pane label="全部" name="all">
        <generic-interview ref="all" />
      </el-tab-pane>
      <el-tab-pane label="未受理" name="unprocessed">
        <generic-interview ref="unprocessed" :query="unprocessedQuery" />
      </el-tab-pane>
      <el-tab-pane label="已接收" name="accept">
        <generic-interview ref="accept" :query="acceptQuery" />
      </el-tab-pane>
      <el-tab-pane label="已拒绝" name="reject">
        <generic-interview ref="reject" :query="rejectQuery" />
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>

<script>
import GenericInterview from './components/GenericInterview'

export default {
  name: 'Interview',
  components: { GenericInterview },
  data() {
    return {
      activeTab: 'all',
      unprocessedQuery: {
        status: 0
      },
      acceptQuery: {
        status: 1
      },
      rejectQuery: {
        status: 2
      }
    }
  },
  methods: {
    getInterviewList() {
      this.$refs.accept.getList()
      this.$refs.reject.getList()
      this.$refs.unprocessed.getList()
      this.$refs.all.getList()
    }
  }
}
</script>
